﻿
Public Class uri
    Private _value As String

    Public Property value() As String
        Get
            Return _value
        End Get
        Set(ByVal value As String)
            '_value = System.Uri.UnescapeDataString(value)
            copy(_value, value)
        End Set
    End Property

    Public Shared Widening Operator CType(ByVal this As uri) As String
        If Not this Is Nothing Then
            Return this.ToString()
        Else
            Return Nothing
        End If
    End Operator

    Public Shared Widening Operator CType(ByVal this As String) As uri
        Dim rtn As uri = Nothing
        rtn = New uri()
        rtn.value = this
        Return rtn
    End Operator

    Public Overrides Function ToString() As String
        'Dim rtn As String = Nothing
        'copy(rtn, value())
        'Return htmlUtils.escape(rtn)
        'Dim rtn As String = Nothing
        'rtn = System.Uri.EscapeUriString(_value)
        'Return rtn
        Return value()
    End Function

End Class
